package com.itheima.controller;

public class ResultType {
    private Integer code;
    private Object data;
    private String msg;

    //增删改只要返回code和data就好了，不需要返回提示信息
    public ResultType(Integer code, Object data) {
        this.code = code;
        this.data = data;

    }


    public ResultType() {
    }

    //查询就需要返回提示信息
    public ResultType(Integer code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", data=" + data +
                ", msg='" + msg + '\'' +
                '}';
    }
}
